Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose EC2 instance lifecycle as label #6914

Merged

Conversation

ghost
Copy link

@ghost ghost commented Mar 1, 2020

Signed-off-by: Alex Gaganov alex.gaganov@fiverr.com

This change exposes the InstanceLifecycle attribute during EC2 service discovery and makes it available as a __meta_ec2_instance_lifecycle label. The attribute's value can be either spot or scheduled. In the case of "regular" instance, the attribute will be nil.
The new label will come in handy when there's a need to distinguish between spot and on-demand instances.

There was an attempt to address this in #6017, however, the PR has some pending comments and got stale due to inactivity :-(

@brian-brazil your input would be greatly appreciated.

@@ -430,6 +430,7 @@ The following meta labels are available on targets during [relabeling](#relabel_
* `__meta_ec2_instance_id`: the EC2 instance ID
* `__meta_ec2_instance_state`: the state of the EC2 instance
* `__meta_ec2_instance_type`: the type of the EC2 instance
* `__meta_ec2_instance_lifecycle`: the lifecycle of the EC2 instance, set only for 'spot' or 'scheduled' instances, absent otherwise
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep it sorted

Signed-off-by: Alex Gaganov <alex.gaganov@fiverr.com>
@ghost ghost force-pushed the ec2sd_add_lifecycle_label branch from e736856 to c4eed12 Compare March 2, 2020 07:51
@ghost ghost requested a review from brian-brazil March 3, 2020 07:58
@brian-brazil brian-brazil merged commit df92a00 into prometheus:master Mar 3, 2020
@brian-brazil
Copy link
Contributor

Thanks!

boyskila pushed a commit to boyskila/prometheus that referenced this pull request Mar 3, 2020
Signed-off-by: Alex Gaganov <alex.gaganov@fiverr.com>
boyskila pushed a commit to boyskila/prometheus that referenced this pull request Mar 3, 2020
Signed-off-by: Alex Gaganov <alex.gaganov@fiverr.com>
Signed-off-by: blalov <boiskila@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant